package com.test.jdk9.newStream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

/**
 * @Description: TODO
 * @Author 赵侠客
 * @Date 2023/6/3
 **/
public class OfNull {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add(null);
        System.out.println(list.stream().count());


        //ofNullable() ：允许值为 null
        Stream<String> stream = Stream.ofNullable(null);
        System.out.println(stream.count());
    }
}
